package exception;

public class ArraysLengthNotMatchException extends Exception {
    private String message = "";

    public ArraysLengthNotMatchException(int aLength, int bLength) {
        this.message = "Rows of the first array is " + aLength + " but the second length is " + bLength + " .";
    }

    public ArraysLengthNotMatchException(int aRows, int aLines, int bRows, int bLines) {
        if (aRows != bRows) {
            this.message = "Rows of the first array is" + aRows + " but the second rows is " + bRows;
        } else if (aLines != bLines) {
            this.message = "Lines of the first array is " + aLines + " but the second lines is " + bLines;
        }
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
